import request from '@/utils/request'

// 获取部门树列表
export function getDeptTreeList(data) {
    return request({
        url: `/system/sysDeptController/getDeptTreeList`,
        method: 'post',
        data: data
    })
}

// 获取部门详情
export function getDeptDetail(id) {
    return request({
        url: `/system/sysDeptController/getDeptDetail?id=${id}`,
        method: 'get'
    })
}

// 新增部门
export function addDept(data) {
    return request({
        url: '/system/sysDeptController/addDept',
        method: 'post',
        data: data
    })
}

// 编辑部门
export function updateDept(data) {
    return request({
        url: '/system/sysDeptController/updateDept',
        method: 'put',
        data: data
    })
}

// 删除部门
export function deleteDept(id) {
    return request({
        url: `/system/sysDeptController/deleteDept?id=${id}`,
        method: 'delete'
    })
}

// 获取部门下拉树
export function getDeptTreeSelect() {
    return request({
        url: `/system/sysDeptController/getDeptTreeSelect`,
        method: 'get'
    })
}
